<div class="main">
    <h1 class="title">Problems</h1>
    <?=form::open_multipart(url::site('problems/upload'))?>
    <div style="margin:20px;">
        <?=form::label('Add new problem package')?><br/>
        <?=form::upload('')?>
        <?=form::submit('add', 'Add')?>
    </div>
    <?=form::close()?>
    
    <table id="problem_list" class="list main" cellpadding="0px" cellspacing="1px">
        <tr>
            <th style="width:30px;">No</th>
            <th id="title">Title</th>
        </tr>
        <?if (($problems == NULL) || (count($problems) == 0)):?>
        <tr class="empty">
            <td colspan="2">There is no problem right now</td>
        </tr>
        <?else:?>
        <?$i = 0;?>
        <?foreach($problems as $problem):?>
        <tr class="<?=text::alternate('odd','even')?> problem">
            <td><?=++$i?></td>
            <td><?=html::anchor(url::site('problems/view/'.$problem->token), '<b>'.$problem->get_property('title')).'</b>'?></td>
        </tr>
        <?endforeach;?>
        <tr class="links">
            <td class="pagination"></td>
        </tr>
        <?endif;?>
    </table>
</div>